<extend name="Base/common"/>

<block name="body">

    <body style="background:#faf8f8;">

    <style type="text/css">

    .xdsoft_datetimepicker{ width: 90%; height: 35%;}
	.StudyHead div.f-fl p{font-size: 28px;margin-top: 0px;color:#999999;height: 40px;line-height:40px;}
	.StudyHead div.f-fl h1 {font-size: 30px;color:#333333;}
	.StudyHead div.f-fl {margin: 20px 0 0 20px;}
	.StudyHead div.f-fl p img {
    margin: 0px 10px -1px 0px;
	}
	.StudyHead div.f-fl h1 span {
	color:#ffad30;
    font-size: 25px;
}

	.StudyHead {
   
    margin:0;
}
.newheader{height:20px;width:100%;background:#faf8f8;border-bottom:1px solid #EFEEEE;}
.newbox{margin:0 20px;}
.StudyHead a.f-fl {
    margin: 20px 0 0 0;
}
#myClass-Study p.Head {
    padding: 20px 0;
	border-bottom:1px solid #EFEEEE;
}
#myClass-Study .listMOr li {
    margin: 0;
    width: 100%;
    border: 0;
    font-size: 28px;
    border-bottom: 1px solid #EFEEEE;
    padding: 20px 0;
    float: right;
    margin: 0;
}

#myClass-Study .newli a {
    padding: 0px 15px 2px;
    background: #ffa721;
    color: #fff;
    font-size: 20px;
    border-radius: 3px;
}

#myClass-Study .newli a.Bac {
    background: #1dce79;
    position: relative;
    color: #fff;
    font-size: 20px;
    border-radius: 3px;
}

#myClass-Study .newli div.over a {
    text-align: center;
    height: 46px;
    line-height: 46px;
    padding: 0;
    display: inline-block;
	width: 30%;
	margin:0 5% 20px 0%;
	float:left;
}


#myClass-Study .newli .Head{
	margin:20px 0;
	border:none;
}

#myClass-Study .newli a.Bac img.pos {
    position: absolute;
    top: -5px;
    right: -5px;
}


.StudyHead div.f-fl img.posi {
    right: -60px;
}

#myClass-Study .newli a.Add {
    background: #faf8f8;
    color: #999;
    font-size: 20px;
}

#myClass-Study .newli a.NoAc {
    background: #ffa721;
}

#myClass-Study .listMOr li a {
    padding: 5px 25px;
}

.renzheng{    
	position: relative;
    margin-top: 20px;
    height: 152px;}
	
.renzheng h1{
color: #ffad30;
    font-size: 28px;
}	

.renzheng img{position: absolute;
    right: 0;
    bottom: 10px;
	}
	
    </style>

        <div id="myClass-Study">

            <header><a href="{:U('Mycourse/course')}" class="back">
			<img src="__IMG__/images/back_03.png"/></a>要教的</header>

                <div class="IndexList">
					<div class="newheader"></div>
					<div class="newbox">
						<div class="StudyHead">
							<div class="per">

								<a href="#" class="f-fl"><img src="__ROOT__{$data.logo|getimg=###}"/></a>

								<div class="f-fl" style="width:auto;">

									
									<h1>{$data.nickname}
									<if condition="$data['sex'] eq 1 ">
									<img src="__IMG__/images/nan_03.png"/>
									<else/><img src="__IMG__/images/girl_03.png"/></if></h1>
									<p><img src="__IMG__/images/idxe_24.jpg"/>授课: {$data.title}</p>

									<p><img src="__IMG__/images/idxe_27.jpg"/>地址: {$data.area_id2|getArea=###}{$data.area_id|getArea=###}</p>

									<p><img src="__IMG__/images/idxe_28.png" width="26px" />手机: {$data.mobile}</p>

								
							
								</div>
								<div class="f-fr renzheng" >
									<h1 >{$data.salary}元/小时</h1>
									<eq name="data.passed" value="1"><img src="__IMG__/images/idxe_21.jpg" class="posi"></eq>
								</div>
								<div class="clear"></div>

							</div>
						</div>
                    <p class="Head">课程安排</p>

                    <ul class="listMOr listlinone">

                    <notempty name="class_ok">

                        <li>

                            <span class="f-fl">下次上课</span>

                            <span class="f-fr"><empty name="nextTime">暂无<else /> {$nextTime.class_date|date="Y-m-d H:i:s",###}</empty></span>

                            <div class="clear"></div>

                        </li>

                        <li>

                            <span class="f-fl">课时</span>

                            <span class="f-fr">{$surplus}</span>

                            <div class="clear"></div>

                        </li>

                        <notempty name="isAt_class">

                            <li>

                                <span class="f-fl">三天内自动确认</span>

                                <span class="f-fr">{$d}天{$h}小时</span>

                                <div class="clear"></div>

                            </li>

                        </notempty>

                    </notempty>

                        <li class="aaaaaaa" style="display:none;">

                            <input type="text" size="60%" value='请选择上课时间' class="datetimepicker_mask search_title class_time" name="trip_time" placeholder="请选择上课时间" style="cursor: auto;" readonly=""/><span class="f-fr">

                            <span class="f-fr class_Ok" style="display:none;margin:7px 0 0 0;" onclick="change($(this))">

                                <span style="float:right;"><a href="###"style="font-size: 2rem;">确定</a></span>

                            </span>

                        </li>

                        <!-- <volist name="time" id="vol"> -->

                            <!-- <gt name="vol.class_date" value="$date"> -->
                                <!-- <li class="chexiaoss" style="overflow:hidden;"> -->

                                    <!-- <span style="float:right;"><a href="javascript:void(0);" class="chexiao" style="font-size: 2rem;">撤销</a></span> -->

                                <!-- </li> -->

                            <!-- </gt> -->

                        <!-- </volist> -->
						
						
						
						<if condition="$is_revoke eq 1 ">
						
							<li class="chexiaoss" style="overflow:hidden;">

                                    <span style="float:right;"><a href="javascript:void(0);" class="chexiao" style="font-size: 2rem;">撤销</a></span>

                            </li>
						
						</if>
						
						
						

                        <empty name="class_ok">

                      
							<notempty name="class_no">														  <li style="border:none;">
								<p><span class="f-fl">评价</span></p>																</else>																<li>
							</notempty>							
                            <notempty name="eva.nickname">

                            <div class="chat">

                                <div class="f-fr">

                                <span href="#" class="F_l f-fl"><img width="90" height="80" src="__ROOT__{$eva.logo|getimg=###}"/></span>

                                    <h4>{$eva.nickname}

                                        <?php echo str_repeat("<img src='__IMG__/images/Star11_11.jpg'/>",$eva['star']);?>

                                        <?php echo str_repeat("<img src='__IMG__/images/Star11_14.jpg'/>",5 - $eva['star']);?>

                                        <span>{$eva.time|date="Y-m-d H:i:s",###}</span>

                                    </h4>

                                    <p>

                                        <volist name="eva['labels']" id="v">

                                           <span>{$v|getItemTitle='labels',###}</span>

                                        </volist>

                                    </p>

                                    <p>{$eva.comment}</p>

                                    <empty name="reply">

                                    <form action="{:U('CourseEva/ajaxEva')}" class="form-horizontal"  method="post">

                                    <strong class="reply">回复</strong>

                                    <div><textarea name="comment" class="text"></textarea></div>

                                        <input type="hidden" name="uid" value="{$uid}">

                                        <input type="hidden" name="eid" value="{$eva.id}">

                                    <input type="submit" style="display:none;" class="ajax-post" target-form="form-horizontal" name="buto" id="buto" value="提 交">

                                    </form>

                                    <else />

                                    <h5><span>({$reply.nickname})老师的回复：</span>{$reply.comment}</h5>

                                    <strong class="reoly-del">删除回复</strong>

                                    <input type="hidden" value="{$reply.id}">

                                    </empty>

                                </div>

                                <div class="clear"></div>

                            </div>

                            </notempty>

                            <div class="clear"></div>

                        </li>

                        </empty>
					</ul>


                        <div class="newli">

                            <p class="Head" style="padding: 0px">时间设置</p>

                            <div class="over">

                            <volist name='time' id='vol' mod='3'>

                               <lt name="vol.class_date" value="$dates">

                                   <neq name="vol.class_date" value="0">

                                       <eq name="vol.at_class" value="1">

                                           <!-- <a href="javascript:;" class="Bac" style='<eq name="mod" value="2">margin:0 0 20px 0;</eq>'>{$vol.class_date|date='Y-m-d H:i:s',###}　{$vol.num}次<img src="__IMG__/images/studyImg_03.png"  class="pos"/></a> -->
										   <!-- lkl修改，去掉次数 -->
                                           <a href="javascript:;" class="Bac" style='<eq name="mod" value="2">margin:0 0 20px 0;</eq>'>{$vol.class_date|date='Y-m-d H:i:s',###}<img src="__IMG__/images/studyImg_03.png"  class="pos"/></a>

                                       <else/>

                                           <!-- <a href="javascript:;" class="Bac" style='<eq name="mod" value="2">margin:0 0 20px 0;</eq>'>{$vol.class_date|date='Y-m-d',###}　{$vol.num}次</a> -->
										   <!-- lkl修改，去掉次数 -->
                                           <a href="javascript:;" class="Bac" style='<eq name="mod" value="2">margin:0 0 20px 0;</eq>'>{$vol.class_date|date='Y-m-d H:i:s',###}</a>

                                       </eq>

                                   </neq>

                               </lt>

                                <gt name="vol.class_date" value="$dates">

                                  <eq name="data.cancel" value="2">

                                    <!-- <a href="javascript:;" class="Bac NoAc" style='<eq name="mod" value="2">margin:0 0 20px 0;</eq>'>退订中{$vol.num}次</a> -->
									<!-- lkl修改，去掉次数 -->
                                    <a href="javascript:;" class="Bac NoAc" style='<eq name="mod" value="2">margin:0 0 20px 0;</eq>'>退订中</a>
								  </eq>								  								   <eq name="data.cancel" value="1">                                    <!-- <a href="javascript:;" class="Bac NoAc" style='<eq name="mod" value="2">margin:0 0 20px 0;</eq>'>退订中{$vol.num}次</a> -->									<!-- lkl修改，去掉次数 -->                                    <a href="javascript:;" class="Add" style='<eq name="mod" value="2">margin:0 0 20px 0;</eq>'>已退订</a>								  </eq>
								<eq name="data.cancel" value="0">
                                    <!-- <a href="javascript:;" class="Bac NoAc class-span" style='<eq name="mod" value="2">margin:0 0 20px 0;</eq>'>{$vol.class_date|date='Y-m-d',###}　{$vol.num}次</a> -->
									<!-- lkl修改，去掉次数 -->
                                    <a href="javascript:;" class="Bac NoAc class-span" style='<eq name="mod" value="2">margin:0 0 20px 0;</eq>'>{$vol.class_date|date='Y-m-d H:i:s',###}</a>

                                    <input type="hidden" value="{$vol.id}">

                                   </eq>

                                </gt>



                                <eq  name="vol.class_date" value="0">

									<eq name="data.cancel" value="2">

										<!-- <a href="javascript:;" class="Add" style='<eq name="mod" value="2">margin:0 0 20px 0;</eq>'>退订中{$vol.num}次</a> -->
										<!-- lkl修改，去掉次数 -->
										<a href="javascript:;" class="Bac NoAc" style='<eq name="mod" value="2">margin:0 0 20px 0;</eq>'>退订中</a>

									<else/>
										<eq name="vol.status" value="3">
										<a href="javascript:;" class="Add" style='<eq name="mod" value="2">margin:0 0 20px 0;</eq>'>已退订</a>
										<else/>
										<!-- <a href="javascript:;" class="Add class-span" style='<eq name="mod" value="2">margin:0 0 20px 0;</eq>'>未定{$vol.num}次</a> -->
										<!-- lkl修改，去掉次数 -->
										<a href="javascript:;" class="Add class-span" style='<eq name="mod" value="2">margin:0 0 20px 0;</eq>'>未定</a>
										</eq>

										<input type="hidden" value="{$vol.id}">

									</eq>

                                </eq>

                            </volist>
                            </div>

                                <!-- <a href="###" class="Bac">2016-10-15  1次 <img src="images/studyImg_03.png" class="pos"/></a>

                                <a href="###" class="Add">未定4次</a>

                                <a href="#" class="Add">未定6次</a> -->

                            <div class="clear"></div>

                        </div>

                </div>
			</div>
        </div>

<script type="text/javascript">

        $(function(){

            $('.chexiaoss:gt(0)').css('display','none');

        });

        $('.chexiao').on('click',function(){

            var orders = {$_GET['order']};
 
            layer.confirm('你确要撤销吗？', {

              btn: ['确定','取消'] 

            }, function(){
			
                $.ajax({
					url: "{:U('chexiao')}",
					type: 'POST',
					dataType: 'json',
					async: false,
					data: {order: orders},
					success: function(data){
                        
					  layer.msg(data, {time: 20000});

                    }
                });
				
				location.reload();
			});
        });

        $('.class-span').on('click',function(){

            $('.aaaaaaa').show();
            $('.class_Ok').show();
            $('.search_title').show();

           var id = $(this).next('input:hidden').val();

           $('.class_Ok').before("<input type='hidden' value='"+id+"'/>");

        });

    //先隐藏时间插件

        $('.search_title').hide();

        //点击展示时间插件追加一个隐藏域

        $('.btn-date').on('click',function(){

            var empty = "{$class_ok}";

            if(empty == ""){

                return false;

            }

           $('.search_title').show();

           $('.class_Ok').show();

           var id = $(this).next('input:hidden').val();

           $('.class_Ok').before("<input type='hidden' value='"+id+"'/>");

        });

        //改变事件传送ajax

        function change(obj){

            var date = $('.class_time').val();

            var id = obj.prev('input[type=hidden]').val();

            $.ajax({

                url: "{:U('Mycourse/mystuAjax')}",

                type: 'POST',

                dataType: 'json',

                data: {"date":date,"id":id},

                success:function(data){

                    layer.alert(data, function(index){

                        window.location.reload();

                        });

                }

            })

        }

        $('.class-button').on('click',function(){

            var uid = $(this).find('input:hidden').val();

            var cid  = $(this).find('input[name=cid]').val();

            window.location.href='__MODULE__/Course/cancel/uid/'+uid+'/cid/'+cid;

        });

         $('.class-btn-ok').on('click',function(){

            var uid = $(this).find('input:hidden').val();

            var cid  = $(this).find('input[name=cid]').val();

            window.location.href='__MODULE__/Course/affirm/uid/'+uid+'/cid/'+cid;

        });

         $('.reoly-del').on('click',function(){

            var id = $(this).next().val();

            layer.confirm('你确要删除吗？', {

              btn: ['确定','取消'] //按钮

            }, function(){

                      $.ajax({

                        url: "{:U('ajaxDel')}",

                        type: 'POST',

                        dataType: 'json',

                        data: {id: id},

                        success:function(del){

                        layer.msg('评论删除成功', {

                          time: 20000, //20s后自动关闭

                                });

                        }

                    })

               location.reload();

            }, function(){

            });

            /*if(confirm("你确要删除吗？")){

                      $.ajax({

                        url: "{:U('ajaxDel')}",

                        type: 'POST',

                        dataType: 'json',

                        data: {id: id},

                        success:function(del){

                        layer.msg('评论删除成功', {

                          time: 20000, //20s后自动关闭

                                });

                        }

                    })

               location.reload();

            }*/

         });

    //回复框显示、隐藏

    $('.reply').toggle(function(){

        $('.text').show(300).focus();

        $('#buto').show(300);

        $(this).html('取消');

    },function(){

        $('.text').hide(300);

        $('#buto').hide(300);

        $(this).html('回复');

    });

    $(function(){

        // $('.over a').eq(0).css('margin-left','0px')

    })

    </script>

<link rel="stylesheet" type="text/css" href="__CSS__/datetimepicker/jquery.datetimepicker.css"/>

<link rel="stylesheet" type="text/css" href="__CSS__/expand.css"/>

<script src="__JS__/datetimepicker/jquery.datetimepicker.js"></script>

<script type="text/javascript">$('.datetimepicker_mask').datetimepicker();</script>

    </body>

</block>
